﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhongthuyTrangChu.ascx.cs" Inherits="WebHousingInfo.Controls.PhongthuyTrangChu" %>
<div>
    <div class="title_tab">
        <ul id="maintab_1">
    <% var objectNew_random = HousingInfo.Library.CategoryBOList.GetCategoryBOList_Random_ByNumber(3);
       int i = objectNew_random.Count;
       int one = 0, two = 0, three = 0, four = 0;              
       if(i>0){
           one = objectNew_random[0].CategoryID;
         %>	    
	      <li class="selected">
	      <a href="#" rel="tcontent_a"><%=objectNew_random[0].CategoryName %></a></li>
	      <%} %>
	      <%if (i > 1)
         {
             two = objectNew_random[1].CategoryID; %>
	      <li><a href="#" rel="tcontent_b"><%=objectNew_random[1].CategoryName %></a></li>
	      <%} %>
	      <%if (i > 2)
         {
             three = objectNew_random[2].CategoryID;
             %>
	       <li><a href="#" rel="tcontent_c"><%=objectNew_random[2].CategoryName%></a></li>
	       <%} %>
	       <%if (i > 3)
          {
              four = objectNew_random[3].CategoryID;
              %>
		    <li><a href="#" rel="tcontent_d"><%=objectNew_random[3].CategoryName%></a></li>
		    <%} %>
	    </ul>
    </div>
    <% int check, check2, count, total; %>
    <%if (one != 0)
      {
          check = 1; check2 = 1; count = 0;
          var objectNews_byIDCate = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(one, 5);
          total = objectNews_byIDCate.Count;
          %>
      
    <div id="tcontent_a" class="tabcontent_1">
        <div id="group_4_other">			
            <div id="phongthuy">
                <div class="content">
                <% foreach (var objectnews_detail in objectNews_byIDCate)
                   {
                       count += 1;
                       if (check == 1)
                       {
                           check = 2; %>
	                <div style="width:475px;">
		                <p><a href="#"><%=objectnews_detail.Title %></a></p>
		                <a href="#"><img src="Images/blank.gif" width="200" height="101" border="0" align="left" class="img" style="background:url(Images/15_1300417562.jpg) no-repeat center center" />
		                </a>
		                <span><%if (objectnews_detail.NewsContent.Length > 200)
                          { %><%=objectnews_detail.NewsContent.Substring(0, 199)%>...<%}
                          else
                          { %><%=objectnews_detail.NewsContent%><%} %> <a href="#">Xem chi tiết</a></span> 
	                </div>
	                <%}
                       else
                       {
                           if (check2 == 1)
                           {
                               check2 = 2;%>
	                <div class="orther_link">
		                <ul>
			                <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>	
                          <%}
                           else
                           { %>		               
                          <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>
                          <%} %> 
                          <%if(count == total){ %>
		                </ul>
	                </div>
	                <%} %>
	                <%}
                   }%>
                </div>
            </div>		
        </div>
	    <div class="footer_kk">
		    <a href="111">Xem thêm</a>
	    </div>				
    </div>
    <%}
      if (two != 0)
      {
          check = 1; check2 = 1; count = 0;
          var objectNews_byIDCate = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(two, 5);
          total = objectNews_byIDCate.Count;%>
    
    <div id="tcontent_b" class="tabcontent_1">
        <div id="group_4_other">			
            <div id="phongthuy">
                <div class="content">
                <% foreach (var objectnews_detail in objectNews_byIDCate)
                   {
                       count += 1;
                       if (check == 1)
                       {
                           check = 2; %>
	                <div style="width:475px;">
		                <p><a href="#"><%=objectnews_detail.Title %></a></p>
		                <a href="#"><img src="Images/blank.gif" width="200" height="101" border="0" align="left" class="img" style="background:url(Images/15_1300417562.jpg) no-repeat center center" />
		                </a>
		                <span><%if (objectnews_detail.NewsContent.Length > 200)
                          { %><%=objectnews_detail.NewsContent.Substring(0, 199)%>...<%}
                          else
                          { %><%=objectnews_detail.NewsContent%><%} %> <a href="#">Xem chi tiết</a></span> 
	                </div>
	                <%}
                       else
                       {
                           if (check2 == 1)
                           {
                               check2 = 2;%>
	                <div class="orther_link">
		                <ul>
			                <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>	
                          <%}
                           else
                           { %>		               
                          <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>
                          <%} %> 
                          <%if(count == total){ %>
		                </ul>
	                </div>
	                <%} %>
	                <%}
                   }%>
                </div>
            </div>		
        </div>    
	    <div class="footer_kk">
		    <a href="222">xem them2</a>
	    </div>				
    </div>
    <%} if (three != 0)
      {
          check = 1; check2 = 1; count = 0;
          var objectNews_byIDCate = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(three, 5);
          total = objectNews_byIDCate.Count; %>
    <div id="tcontent_c" class="tabcontent_1">
        <div id="group_4_other">			
            <div id="phongthuy">
                <div class="content">
                <% foreach (var objectnews_detail in objectNews_byIDCate)
                   {
                       count += 1;
                       if (check == 1)
                       {
                           check = 2; %>
	                <div style="width:475px;">
		                <p><a href="#"><%=objectnews_detail.Title %></a></p>
		                <a href="#"><img src="Images/blank.gif" width="200" height="101" border="0" align="left" class="img" style="background:url(Images/15_1300417562.jpg) no-repeat center center" />
		                </a>
		                <span><%if (objectnews_detail.NewsContent.Length > 200)
                          { %><%=objectnews_detail.NewsContent.Substring(0, 199)%>...<%}
                          else
                          { %><%=objectnews_detail.NewsContent%><%} %> <a href="#">Xem chi tiết</a></span> 
	                </div>
	                <%}
                       else
                       {
                           if (check2 == 1)
                           {
                               check2 = 2;%>
	                <div class="orther_link">
		                <ul>
			                <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>	
                          <%}
                           else
                           { %>		               
                          <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>
                          <%} %> 
                          <%if(count == total){ %>
		                </ul>
	                </div>
	                <%} %>
	                <%}
                   }%>
                </div>
            </div>		
        </div>	
	    <div class="footer_kk">
		    <a href="333">Xem Them3</a>
	    </div>				
    </div>
    <%} if (four != 0)
      { 
      check = 1; check2 = 1; count = 0;
      var objectNews_byIDCate = HousingInfo.Library.NewsBOList.GetNewsBOList_ByNoiThat(four, 5);
          total = objectNews_byIDCate.Count;%>
    <div id="tcontent_d" class="tabcontent_1">
        <div id="group_4_other">			
            <div id="phongthuy">
                <div class="content">
                <% foreach (var objectnews_detail in objectNews_byIDCate)
                   {
                       count += 1;
                       if (check == 1)
                       {
                           check = 2; %>
	                <div style="width:475px;">
		                <p><a href="#"><%=objectnews_detail.Title %></a></p>
		                <a href="#"><img src="Images/blank.gif" width="200" height="101" border="0" align="left" class="img" style="background:url(Images/15_1300417562.jpg) no-repeat center center" />
		                </a>
		                <span><%if (objectnews_detail.NewsContent.Length > 200)
                          { %><%=objectnews_detail.NewsContent.Substring(0, 199)%>...<%}
                          else
                          { %><%=objectnews_detail.NewsContent%><%} %> <a href="#">Xem chi tiết</a></span> 
	                </div>
	                <%}
                       else
                       {
                           if (check2 == 1)
                           {
                               check2 = 2;%>
	                <div class="orther_link">
		                <ul>
			                <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>	
                          <%}
                           else
                           { %>		               
                          <li><a href="#"><%if (objectnews_detail.Title.Length > 30)
                                     { %><%=objectnews_detail.Title.Substring(0, 29)%>...<%}
                                     else
                                     { %><%=objectnews_detail.Title%><%} %></a></li>
                          <%} %> 
                          <%if(count == total){ %>
		                </ul>
	                </div>
	                <%} %>
	                <%}
                   }%>
                </div>
            </div>		
        </div>	
	    <div class="footer_kk">
		    <a href="444">Xem Them4</a>
	    </div>	    	      	    
    </div>
    <%} %>
    <script type="text/javascript">
		    initializetabcontent("maintab_1")
    </script>
</div>